<template>
  <DetailDescTable ref="DetailDescTable" :title="$tt('label_warehouse_location_detail')" :descOption="detailDesc"
                   :url="detailUrl" :urlDataHandle="detailUrlDataHandle"/>
</template>

<script>
import DetailDescTable from "../detail_common.vue";
export default {
  name: "detail_location",
  components: {DetailDescTable},
  data() {
    return {
      detailUrl: '/wms-api/base/WmsBaseLocationRpc/detail.json',
      detailUrlDataHandle: (res) => {
        let {wavePlanDetailDTOList, ...descData} = res.data
        return {
          descData, tableData: wavePlanDetailDTOList,
        }
      },
      detailDesc: {
        model: [
          {key: 'code', label: 'label_warehouse_area_code'},
          {key: 'status', label: 'label_status', formatter: (r,c,v) => this.$enumShow(v, "IsAvailableStatusEnum")},
          {key: 'warehouseName', label: 'label_warehouse_name'},
          {key: 'areaCode', label: 'label_warehouse_area_code'},
          {key: 'alleyCode', label: 'label_tunnel_code'},
          {key: 'shelfFloor', label: 'label_shelf_floor'},

          { key: 'skuType', label: 'label_sku_type', },
          { key: 'maxBoxNum', label: 'label_maximum_number_boxes', },
          { key: 'maxBoardNum', label: 'label_minimum_number_pallet', },
   
          { key: 'mixFlag', label: 'label_is_mix', formatter: (r,c,v) => this.$enumShow(v, "YesOrNoEnum")},
          { key: 'mixAllowBatchFlag', label: 'label_is_mix_batch', formatter: (r,c,v) => this.$enumShow(v, "YesOrNoEnum") },

          { key: 'length', label:'label_length',formatter: (r, c, v, i) => `${v}cm`},
          { key: 'width', label: 'label_width',formatter: (r, c, v, i) => `${v}cm` },
          { key: 'height', label: 'label_height',formatter: (r, c, v, i) => `${v}cm`},
          { key: 'weight', label: 'label_weight',formatter: (r, c, v, i) => `${v}kg` },
          { key: 'volume', label: 'label_capacity',formatter: (r, c, v, i) => `${v}m³` },

          { key: 'coordinateX', label: 'label_x_axis', },
          { key: 'coordinateY', label: 'label_y_axis', },
          { key: 'coordinateZ', label: 'label_z_axis', },
          { key: 'locationDirect', label: 'label_warehouse_location_toward', },
          {key: 'creator', label: 'label_create_user',},
          {key: 'gmtCreate', label: 'label_create_time',  formatter: (r, c, v, i) => this.$dateFormat(v)},


          { key: 'storageRatio', label: 'label_restriction_ratio',formatter: (r, c, v, i) => `${v}%` },
          { key: 'inboundLimitType', label: 'label_limit_inbound_type', formatter: (r,c,v) => this.$enumShow(v, "BaseLimitInboundTypeEnum") },
          { key: 'allowPick', label: 'label_allow_picking',  formatter: (r,c,v) => this.$enumShow(v, "YesOrNoEnum") },
          { key: 'pickSort', label: 'label_picking_order' },
          { key: 'description', label: 'label_description', },
        ],
      },
    }
  },
  methods: {
    show({title, ...obj}) {
      this.$refs['DetailDescTable'].show(obj)

    },

    hide() {
      this.$refs['DetailDescTable'].hide()
    },

  }
}
</script>

<style scoped>

</style>
